<?php

namespace BackendBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class DefaultController extends Controller
{
    public function indexAction()
    {
//        $knp_snappy = $this->get('knp_snappy.image');
//        $knp_snappy->generate('http://blog.it985.com/', dirname(dirname(dirname(dirname(__FILE__)))) . '/web/upload/blog.jpg');
//        $this->get('knp_snappy.pdf')->generate(array('http://fanyi.baidu.com/#en/zh/','http://www.baidu.com'), dirname(dirname(dirname(dirname(__FILE__)))) . '/web/upload/ige.jpg');
//
//        $html = $this->renderView('BackendBundle:Default:index.html.twig');
//
//        return new Response(
//            $this->get('knp_snappy.pdf')->getOutputFromHtml($html),
//            200,
//            array(
//                'Content-Type'          => 'application/pdf',
//                'Content-Disposition'   => 'filename="image.jpg"'
//            )
//        );

//        $pageUrl = $this->generateUrl('fortend_homepage', array(), true); // use absolute path!
//
//        return new Response(
//            $this->get('knp_snappy.pdf')->getOutput($pageUrl),
//            200,
//            array(
//                'Content-Type'          => 'application/pdf',
//                'Content-Disposition'   => 'attachment; filename="file.pdf"'
//            )
//        );
        return $this->render('BackendBundle:Default:index.html.twig');
    }
    
}
 